var testConfig = require('../testConfig');
function TestProject() {
  this.init = function () {
    var arr = [];
    arr.push(
      this.step1,
      this.step2,
      this.step3,
      this.step4,
      this.step5,
      this.step6,
      this.step7,
      this.step8,
      this.step9,
      this.step10,
      this.step11,
      this.step12,
      this.step13,
      this.step14,
      this.step15,
      this.step16,
      this.step17,
      this.step18,
      this.step19,
      this.step20,
      this.step21,
      this.step22,
      this.step23
    );
    testConfig.testFun.runStep(arr);
  };
  var uploadImg = "http://choosefine-uat.oss-cn-hangzhou.aliyuncs.com/shopping/user/20170704140050ninZMbBaTs.jpg";
  this.step1 = function () {
    $("#aside-nav").find("div.coords").eq(2).find("a")[0].click();
  };
  this.step2 = function () {
    testConfig.testFun.ai().find("input[data-name='projectName']").val("姬自动化测试");
  };
  this.step3 = function () {
    testConfig.testFun.ai().find("#teamCapitalBtn").click();
  };
  this.step4 = function () {
    testConfig.testFun.ai().find("tr[data-index='0'] td")[0].click();
  };
  this.step5 = function () {
    testConfig.testFun.bi().find("#editProjectInfo").click();
  };
  this.step6 = function () {
    testConfig.testFun.ci().find("li.toEditTeamBasicInfo a")[0].click();
  };
  this.step7 = function () {
    testConfig.testFun.ci().find("#addTeam").click();
  };
  this.step8 = function () {
    testConfig.testFun.di().find("input[data-name='teamName']").val("姬班组自动化测试4");
  };
  this.step9 = function () {
    testConfig.testFun.di().find("input[data-name='userName']").val("姬班组承包人测试人人").attr('usercode', 'PS979425SZZYBG');
  };
  this.step10 = function () {
    testConfig.testFun.di().find("input[data-name='affiliatedUnitsId']").val("姬分包单位测试").attr('unitcode','CP93620QMJH4').attr('unitid','85');
  };
  this.step11 = function () {
    testConfig.testFun.di().find("#wrap_c img").attr("src", uploadImg);
  };
  this.step12 = function () {
    testConfig.testFun.di().find("#wrap_d img").attr("src", uploadImg);
  };
  this.step13 = function () {
    testConfig.testFun.di().find("input[data-name='totalPrice']").val("66");
  };
  this.step14 = function () {
    testConfig.testFun.di().find("select[data-name='contractType']").html("<option value='LIGHT'>清包</option>");
  };
  this.step15 = function () {
    testConfig.testFun.di().find(".resure")[0].click();
  };
  this.step16 = function () {
    testConfig.testFun.ei().find("#addWorker").click();
  };
  this.step17 = function () {
    testConfig.testFun.fi().find("#builder").val("姬工人测试").attr('usercode', 'PS170199CN5CSH');
  };
  this.step18 = function () {
    testConfig.testFun.fi().find("input[data-name='workerTypeIdes']").val("桩基设备").attr('name', '100015');
  };
  this.step19 = function () {
    testConfig.testFun.fi().find("input[data-name='workTime']").val('2017-08-04');
  };
  this.step20 = function () {
    testConfig.testFun.fi().find(".finish").click();
  };
  this.step21 = function () {
    testConfig.testFun.ei().find("#saveNext").click();
  };
  this.step22 = function () {
    testConfig.testFun.fi().find(".callBack")[0].click();
  };
  this.step23 = function () {
    testConfig.testFun.ci().find(".finish")[0].click();
  };
}
function testStart() {
  var test = new TestProject();
  test.init();
}
exports.start = testStart;
